<!--
 * @description  :物品代保管列表item
 * @descriptionDetail:物品代保管列表item
 * @copyright    : 浙江烟草
 * @author       : dw
 * @create       : 2022-12-22 15:43:41
-->
<template>
  <view class="page" style="padding-bottom:0" @tap="itemClick">
    <view class="invent-content">
      <view class="invent-right">
        <view class="r-content">
          <text class="lt-right-title-label">
            {{ itemInfo.custodyNo }}
          </text>
        </view>
        <view class="peo-sty title-sty" style="align-items: center;padding-top: 10rpx;">
          <view>
            <text>
              创建日期：
            </text>
            <text>
              {{ itemInfo.createTime }}
            </text>
          </view>
          <u-tag style="flex-shrink: 0;" :spStyle="getSpStyle(itemInfo)" mode="dark" shape="circle" :text="itemInfo.custodyStatusName"></u-tag>
        </view>
        <view class="peo-sty">
          <view>
            <span>{{ itemInfo.storeName || '/' }}</span> - <span>{{ itemInfo.custodyTypeName || '/' }}</span>
          </view>
        </view>
        <view class="peo-sty">
          <view>
            <span>案件编号：</span>
            <span>{{ itemInfo.caseCode }}</span>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { C_CUSTODY_STATUS, } from "@/service/store/mapping/enum.js"
const sysCodeColors = {
  "02": {
    color: "#01A79A",
    borderColor: "#01A79A",
    backgroundColor: "#C0ECE2",
  },
  "05": {
    color: "#AC0000",
    borderColor: "#AC0000",
    backgroundColor: "#F2CCCC",
  },
  "04": {
    color: "#0079F2",
    borderColor: "#0079F2",
    backgroundColor: "#E0ECFF",
  },
  "03": {
    color: "#EC7C37",
    borderColor: "#EC7C37",
    backgroundColor: "#FBE2D3",
  },
};
export default {
  props: {
    itemInfo: {
      type: Object,
      default: () => {
        return {}
      },
    },
  },
  data() {
    return {
    };
  },
  methods: {
    getSpStyle(it){
      if(it.custodyStatus == C_CUSTODY_STATUS.C_CUSTODY_STATUS_02){
        return sysCodeColors[it.custodyStatus] || {};
      }else if(it.custodyStatus == C_CUSTODY_STATUS.C_CUSTODY_STATUS_03){
        return sysCodeColors[it.custodyStatus] || {};
      }else if(it.custodyStatus == C_CUSTODY_STATUS.C_CUSTODY_STATUS_04){
        return sysCodeColors[it.custodyStatus] || {};
      }else if(it.custodyStatus == C_CUSTODY_STATUS.C_CUSTODY_STATUS_05){
        return sysCodeColors[it.custodyStatus] || {};
      }
    },
    itemClick () {
      if (this.itemInfo.caseType == 'trans_case') {
        this.setRouteParam(this.itemInfo);
        // 跳转到 移送案件代管出库的详情页面
        this.$u.route("pages/store/artcle/ArticleListItem");
      } else if (this.itemInfo.caseType == 'cmd_case') {
        this.setRouteParam(this.itemInfo);
        // 跳转到 外单位案件代管出库的详情页面
        this.$u.route("pages/store/artcle/outsideCsaeItem");
      }
    },
  },
};
</script>

<style lang="scss" scoped>
	@import "../inventoryManage/inven_common.scss";
  .page{
    padding: 0;
  }
  .content {
		background-color: #F3F4F5 ;
    min-height: 100%;
	}
  .list-item-root {
  margin: 10px;
  border-radius: 15px;
  overflow: hidden;
}
.invent-content{
  padding: 24rpx;
}
.lt-right-title-value{
	// margin-left: 16rpx;
	font-size: 30rpx;
	font-weight: 400;
	color: $u-type-warning-dark;
}
.lt-right-title-label{
	font-size: 30rpx;
	font-weight: 600;
	color: $u-main-color;
}

	.key-search-lay {
		background-color: #fff;
		position: fixed;
		/* #ifdef H5-DINGDING  */
		top: 0px;
		/* #endif */
		/* #ifndef H5-DINGDING  */
		top: 44px;
		/* #endif */
		z-index: 999;
		width: 100%;

		.key-search {
			padding: 0 10px;
		}
	}

	.nav-right-icon {
		margin-right: 30rpx;
		font-size: .8rem;
		color: $u-type-primary;
	}
  .title-sty{
    padding-bottom: 22rpx;
    border-bottom: 1px solid #ebebec
  }
  .peo-sty{
    display: flex;
    justify-content: space-between;
    padding-top: 24rpx;
    font-size: 26rpx;
  }
  .label-sty{
    color: #82848a;
    padding-right: 20rpx;
  }
  .value-sty{
    color: #ee8c4f;
  }
  .content-sty{
    color: #82848a;
    background-color: #fafafa;
    padding: 20rpx 10rpx;
    margin-top: 24rpx;
    font-size: 24rpx;
    display: flex;
    justify-content: space-between;
  }
  .pad-top{
    padding-top: 14rpx;
  }
</style>
